//
//  NetWorkShare.h
//  ETong
//
//  Created by wanzhao on 15/10/28.
//  Copyright (c) 2015年 wanzhao. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Reachability.h"
#import "AFNetworking.h"
#import "MBProgressHUD+WZ.h"
#import "MJExtension.h"
#import "MJRefresh.h"

typedef void(^successHandle) (AFHTTPRequestOperation *operation, id responseObject);
typedef void(^failureHandle) (AFHTTPRequestOperation *operation, NSError *error);

@interface NetWorkShare : NSObject

@property (nonatomic, strong) Reachability *reachability;
+ (NetWorkShare *)netWorkShareInstance;

/**登录*/
+ (void)loginOAWithUserName:(NSString *)userName pwd:(NSString *)pwd successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**登出*/
+ (void)loginOutOAWithUserId:(NSString *)userId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**考勤服务站点*/
+ (void)getIpAddressWithUserId:(NSString *)userId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**日程查询*/
+ (void)queryScheduleWithUserName:(NSString *)userName pwd:(NSString *)pwd beginTime:(NSString *) beginTime endTime:(NSString *)endTime alertBeginTime:(NSString *)alertBeginTime alertEndTime:(NSString *) alertEndTime successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**日程详细*/
+ (void)getByIDWithUserName:(NSString *)userName pwd:(NSString *)pwd scheduleID:(NSString *)scheduleID successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**删除日程*/
+ (void)deleteByIDWithUserName:(NSString *)userName pwd:(NSString *)pwd scheduleID:(NSString *)scheduleID successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**保存日程*/
+ (void)saveScheduleWithUserName:(NSString *)userName pwd:(NSString *)pwd scheduleID:(NSString *)scheduleID scheduleTitle:(NSString *)scheduleTitle startTime:(NSString *)startTime alertTime:(NSString *)alertTime alertFlag:(NSString *)alertFlag beforeLength:(NSString *)beforeLength beforeUnitFlag:(NSString *)beforeUnitFlag editFlag:(NSString *)editFlag successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**获取任务所有状态*/
+ (void)getTaskStatusWithName:(NSString *) name pwd:(NSString *)pwd SuccessHandle:(successHandle)successHandle FailureHandle:(failureHandle)failureHandle;

/**获取任列表*/
+ (void)getTaskListWithParams:(NSDictionary *) params SuccessHandle:(successHandle)successHandle FailureHandle:(failureHandle)failureHandle;

/**获取任务的详细信息*/
+ (void)getTaskDetailInforWithParams:(NSDictionary *) params SuccessHandle:(successHandle)successHandle FailureHandle:(failureHandle)failureHandle;

/**执行人接受或者拒绝任务*/
+ (void)acceptAndRefuseWithParams:(NSDictionary *) params SuccessHandle:(successHandle)successHandle FailureHandle:(failureHandle)failureHandle;

/**分配人审核*/
+ (void)assignerAuthorizedWithParams:(NSDictionary *) params SuccessHandle:(successHandle)successHandle FailureHandle:(failureHandle)failureHandle;

/**分配人查找待办*/
+ (void)assignerFetchScheduleWithParams:(NSDictionary *)params SuccessHandle:(successHandle)successHandle FailureHandle:(failureHandle)failureHandle;

/**提交任务进度*/
+ (void)saveProgressWithParams:(NSDictionary *) params SuccessHandle:(successHandle)successHandle FailureHandle:(failureHandle)failureHandle;

/**申请延期任务*/
+ (void)applyForDelayWithParams:(NSDictionary *) params SuccessHandle:(successHandle)successHandle FailureHandle:(failureHandle)failureHandle;

/**申请任务完成*/
+ (void)finishedTaskWithParams:(NSDictionary *)params SuccessHandle:(successHandle)successHandle FailureHandle:(failureHandle)failureHandle;

/**任务日志*/
+ (void)getTaskManagerLogWithParams:(NSDictionary *)params SuccessHandle:(successHandle) successHandle FailureHandle:(failureHandle)failureHandle;


/**获取个人信息*/
+ (void)getPersonalInfoWithUserId:(NSString *)userId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**
 修改个人信息
 dict参数：userId，mobile，telephone，mail
 */
+ (void)updatePersonalInfoWithUpdateDict:(NSDictionary *)dict successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**设置头像*/
+ (void)updateHeaderImageWithUserId:(NSString *)userId  imageData:(NSData *)imageData successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**重置密码*/
+ (void)resetPWDWithUserId:(NSString *)userId newPwd:(NSString *)newPwd oldPwd:(NSString *)oldPwd successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;


/**版本更新*/
+ (void)getNewVersionWithCurrentVersion:(NSString *)curVersion successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**问题答疑*/
+ (void)getQuestionListWithQuestionTitle:(NSString *)quetionTitle pageNO:(NSString *)pageNO pageSize:(NSString *)pageSize successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**问题答疑详情*/
+ (void)getQuestionDetailWithQuestionID:(NSString *)questionId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**意见反馈*/
+ (void)submitSuggestionWithUserId:(NSString *)userId suggestion:(NSString *)suggestion modelId:(NSString *)modelId modelName:(NSString *)modelName successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**意见反馈可选模块列表*/
+ (void)getSuggestCategoryWithSuccessHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

//下载新版本
+ (void)updateVersionWithUrlStr:(NSString *)urlStr successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**当天外出单列表*/
+ (void)getOutListWithUserid:(NSString *)userId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**外出签到或者签退*/
+ (void)outSignOrSignOutWithUserId:(NSString *)userId applyid:(NSString *)applyId typeFlag:(NSString *)typeFlag address:(NSString *)address longitude:(NSString *)longitude latitude:(NSString *)latitude successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**外出单流程*/
+ (void)outSignOrSignOutWithProcedureParameters:(NSDictionary *)parameters successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**签到统计*/
+ (void)getOutSignListWithUserId:(NSString *)userId staticDate:(NSString *)staticDate orderFlag:(NSString *)orderFlag successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**手机考勤,当天外出单列表*/
+ (void)getMobileCurdaySignListWithUserId:(NSString *)userId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**外出手机签到签退*/
+ (void)OutMobileSignOrSignOutWithUserId:(NSString *)userId signFlag:(NSString *)signFlag address:(NSString *)address successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**外出手机打卡流程*/
+ (void)OutMobileSignOrSignOutProcedureWithParameters:(NSDictionary *)parameters successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**公司内手机考勤*/
+ (void)mobileSignOrSignOutWithUserId:(NSString *)userId signFlag:(NSString *)signFlag address:(NSString *)address successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**验证内网是否通*/
+ (void)checkInlineIsAvalibleWithsuccessHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**获取当前系统时间*/
+ (void)getServerTimeWithsuccessHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**验证手机是否认证*/
+ (void)checkMobileWithUserId:(NSString *)userId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**手机认证*/
+ (void)certifyMobileWithUserId:(NSString *)userId phone:(NSString *)phone simUuid:(NSString *)simUuid mobileUuid:(NSString *)mobileUuid successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**验证是否在公司*/
+ (void)checkIntraCompanyWith:(NSString *)urlStr successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;


//流程申请
+ (void)workFlowApplyWithLoginName:(NSString *)loginName password:(NSString *)password companyId:(NSString *)companyId pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize category:(NSString *)category successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

/**根据流程申请获取对应流程*/
+ (void)getWorkFlowWithApplyAndLoginName:(NSString *)loginName password:(NSString *)password companyId:(NSString *)companyId FormId:(NSString *)formId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

//已申请流程
+ (void)yiShengQingLiuChengWithLoginName:(NSString *)loginName password:(NSString *)password companyId:(NSString *)companyId pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize category:(NSString *)category successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;
//待办流程
+ (void)daiBanLiuChengWithLoginName:(NSString *)loginName password:(NSString *)password companyId:(NSString *)companyId pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize category:(NSString *)category successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

//已办流程
+ (void)yiBanLiuChengWithLoginName:(NSString *)loginName password:(NSString *)password companyId:(NSString *)companyId pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize category:(NSString *)category successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

//草稿箱
+ (void)caoGaoXiangWithLoginName:(NSString *)loginName password:(NSString *)password companyId:(NSString *)companyId pageNo:(NSString *)pageNo pageSize:(NSString *)pageSize category:(NSString *)category successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

//流程日志
+ (void)liuChengRiZhiWithcaoGaoXiangWithLoginName:(NSString *)loginName password:(NSString *)password companyId:(NSString *)companyId processInstanceId:(NSString *)processInstanceId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;
//删除草稿
+ (void)delDraftWithUrlStr:(NSString *)urlStr draftId:(NSString *)draftId loginName:(NSString *)loginName password:(NSString *)password companyId:(NSString *)companyId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

//+ (void)delDraftWithUrlStr:(NSString *)urlStr draftId:(NSString *)draftId successHandle:(successHandle)successHandle failureHandle:(failureHandle)failureHandle;

@end
